package com.retallife.user.service.Order.Impl;


import com.retallife.user.dao.Order.OrderMapper;
import com.retallife.user.pojo.Order.UserOrderNameVo;
import com.retallife.user.pojo.Order.UserAddOrderVo;
import com.retallife.user.pojo.Order.UserOrderNumberVo;
import com.retallife.user.pojo.Order.UserOrderVo;
import com.retallife.user.service.Order.OrderService;
import org.springframework.beans.factory.annotation.Autowired;
import org.springframework.stereotype.Service;

import java.util.List;

@Service
public class OrderServiceImpl implements OrderService {
    @Autowired
    OrderMapper orderMapper;

    /**
     * 查询某个用户的订单
     * @param userOrderNameVo
     * @return 是否查询成功
     */
    public List<UserOrderVo> FindOrderGoods(UserOrderNameVo userOrderNameVo) {
        return orderMapper.FindOrderGoods(userOrderNameVo);
    }

    /**
     * 查询某个用户的正在处理的订单
     * @param userOrderNameVo
     * @return 是否查询成功
     */
    public List<UserOrderVo> FindOrderGoodsIng(UserOrderNameVo userOrderNameVo) {
        return orderMapper.FindOrderGoodsIng(userOrderNameVo);
    }

    /**
     * 查询某个用户的订单成功处理的信息
     * @param userOrderNameVo
     * @return 是否查询成功
     */
    public List<UserOrderVo> FindOrderGoodsRefund(UserOrderNameVo userOrderNameVo) {
        return orderMapper.FindOrderGoodsRefund(userOrderNameVo);
    }

    /**
     * 往订单表中添加商品
     * @param userAddOrderVo
     * @return 是否增加成功
     */
    public int AddOrderGoods(UserAddOrderVo userAddOrderVo) {
        return orderMapper.AddOrderGoods(userAddOrderVo);
    }

    /**
     * 根据用户的订单号，修改信息
     * @param userOrderNumberVo
     * @return
     */
    public int UpdateOrderGoods(UserOrderNumberVo userOrderNumberVo) {
        return orderMapper.UpdateOrderGoods(userOrderNumberVo);
    }

}
